package com.fanbai.score.common.Utils.log;

/**
 * 写日志线程类
 * 
 * @author hebin
 *
 */
class YD_LogWriteThread extends Thread {

	public static boolean isWriteThreadLive = false;// 写日志线程是否已经在运行了

	@Override
	public void run() {
		isWriteThreadLive = true;
		while (!YD_Log.getLogQueue().isEmpty()) {// 对列不空时
			try {
				YD_LogInfo logInfo = YD_Log.getLogQueue().poll();
				YD_Log.writeFile(logInfo.getFiileName(), logInfo.getContent());
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		isWriteThreadLive = false;// 队列中的日志都写完了，关闭线程（也可以常开 要测试下）
	}
}
